/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package model.pojo;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 *
 * @author Yasith
 */
@Entity
@Table(name = "userprofiles")
@NamedQueries({@NamedQuery(name = "UserProfile.findByUserID", query = "SELECT u FROM UserProfile u WHERE u.userID = :userID"), @NamedQuery(name = "UserProfile.findByAge", query = "SELECT u FROM UserProfile u WHERE u.age = :age"), @NamedQuery(name = "UserProfile.findByGender", query = "SELECT u FROM UserProfile u WHERE u.gender = :gender"), @NamedQuery(name = "UserProfile.findByAboutMe", query = "SELECT u FROM UserProfile u WHERE u.aboutMe = :aboutMe"), @NamedQuery(name = "UserProfile.findByMyInterest", query = "SELECT u FROM UserProfile u WHERE u.myInterest = :myInterest"), @NamedQuery(name = "UserProfile.findByPhotoLink", query = "SELECT u FROM UserProfile u WHERE u.photoLink = :photoLink"), @NamedQuery(name = "UserProfile.findByVideoLink", query = "SELECT u FROM UserProfile u WHERE u.videoLink = :videoLink"), @NamedQuery(name = "UserProfile.findByCreationDate", query = "SELECT u FROM UserProfile u WHERE u.creationDate = :creationDate"), @NamedQuery(name = "UserProfile.findByLastUpdatedDate", query = "SELECT u FROM UserProfile u WHERE u.lastUpdatedDate = :lastUpdatedDate")})
public class UserProfile implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "userID", nullable = false)
    private Integer userID;
    @Column(name = "age", nullable = false)
    private int age;
    @Column(name = "gender")
    private String gender;
    @Column(name = "aboutMe")
    private String aboutMe;
    @Column(name = "myInterest")
    private String myInterest;
    @Column(name = "photoLink")
    private String photoLink;
    @Column(name = "videoLink")
    private String videoLink;
    @Column(name = "creationDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date creationDate;
    @Column(name = "lastUpdatedDate")
    @Temporal(TemporalType.TIMESTAMP)
    private Date lastUpdatedDate;
    @JoinColumn(name = "countryID", referencedColumnName = "countryID")
    @ManyToOne
    private Country countryID;

    public UserProfile() {
    }

    public UserProfile(Integer userID) {
        this.userID = userID;
    }

    public UserProfile(Integer userID, int age) {
        this.userID = userID;
        this.age = age;
    }

    public Integer getUserID() {
        return userID;
    }

    public void setUserID(Integer userID) {
        this.userID = userID;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getAboutMe() {
        return aboutMe;
    }

    public void setAboutMe(String aboutMe) {
        this.aboutMe = aboutMe;
    }

    public String getMyInterest() {
        return myInterest;
    }

    public void setMyInterest(String myInterest) {
        this.myInterest = myInterest;
    }

    public String getPhotoLink() {
        return photoLink;
    }

    public void setPhotoLink(String photoLink) {
        this.photoLink = photoLink;
    }

    public String getVideoLink() {
        return videoLink;
    }

    public void setVideoLink(String videoLink) {
        this.videoLink = videoLink;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public Date getLastUpdatedDate() {
        return lastUpdatedDate;
    }

    public void setLastUpdatedDate(Date lastUpdatedDate) {
        this.lastUpdatedDate = lastUpdatedDate;
    }

    public Country getCountryID() {
        return countryID;
    }

    public void setCountryID(Country countryID) {
        this.countryID = countryID;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (userID != null ? userID.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof UserProfile)) {
            return false;
        }
        UserProfile other = (UserProfile) object;
        if ((this.userID == null && other.userID != null) || (this.userID != null && !this.userID.equals(other.userID))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "model.pojo.UserProfile[userID=" + userID + "]";
    }

}
